{% extends 'BcBootstrapBundle:Form:form_div_layout.html.twig' %}
{# Labels #}

{% block form_label %}
{% spaceless %}
    {% if not compound %}
        {% set label_attr = label_attr|merge({'for': id}) %}
    {% endif %}
    {% if required %}
        {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
    {% endif %}
    {% if form_type is defined and form_type == 'horizontal' %}
        {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' control-label')|trim}) %}
    {% endif %}
    {% if label is empty %}
        {% set label = name|humanize %}
    {% endif %}
    <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
        {{ label|trans({}, translation_domain) }}
        {% if label_attr['sure'] is defined %}
            <sup style="color:red;">*</sup>
        {% endif %}
    </label>
{% endspaceless %}
{% endblock form_label %}

{% block text_filter_widget %}
    {% spaceless %}
        <ul>
        {% for child in form %}
            <li>{{ form_widget(child) }}</li>
        {% endfor %}
        </ul>
    {% endspaceless %}
{% endblock %}

{% block choice_filter_widget %}
    {% spaceless %}
        <ul>
        {% for child in form %}
            <li>{{ form_widget(child) }}</li>
        {% endfor %}
        </ul>
    {% endspaceless %}
{% endblock %}

{% block boolean_filter_widget %}
    {% spaceless %}
        <ul>
        {% for child in form %}
            <li>{{ form_widget(child) }}</li>
        {% endfor %}
        </ul>
    {% endspaceless %}
{% endblock %}

{% block entity_filter_widget %}
    {% spaceless %}
        <ul>
        {% for child in form %} 
            <li>{{ form_widget(child) }}</li>
        {% endfor %}
        </ul>
    {% endspaceless %}
{% endblock %}

{% block jquery_entity_combobox_widget %}
    {{ block('choice_widget') }}
    {% spaceless %}
    <style>
	.ui-button { margin-left: -1px; }
	.ui-button-text { padding: 0 !important; }
	.ui-autocomplete-input { background: #FFFFFF; margin: 0; }
        button.ui-button-icon-only { height: 1.4em; width: 1.4em; }
        button.ui-icon { margin-top: 5px; }
        .ui-autocomplete{ border: none; }
        .ui-autocomplete li{  background: #FFFFFF; }
    </style>
    <script type="text/javascript">
      $(function(){
        $( "#{{ id }}" ).autocomplete();
      	$( "#{{ id }}" ).combobox();
     });
    </script>
    {% endspaceless %}
{% endblock %}

{% block date_filter_widget %}
    {% spaceless %}
        <ul>
        {% for child in form %} 
            <li>{{ form_widget(child) }}</li>
        {% endfor %}
        </ul>
    {% endspaceless %}
{% endblock %}

{% block zk_multi_select_widget %}
    {% spaceless %}
    <script type="text/javascript">
      $(function(){
        $( "#{{ id }}" )
            .ZkMultiSelectWidget({
                ZkHeight: {{ ZkHeight }},
                ZkWidth:  {{ ZkWidth }},
                ZkSearch: {{ ZkSearch }},
                ZkRange:  {{ ZkRange }},
	        ZkDescr:  {{ ZkDescr|raw }}
            });
     });
    </script>
    {{ block('choice_widget_collapsed') }}
    {% endspaceless %}
{% endblock %}